<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>哈哈</h1>

<div id="app" style="width: 500px;height: 300px;background-color: aqua">

</div>
<!--前端发送请求的-->
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
    const http = axios.create({
        baseURL: 'http://localhost:8080/',
        timeout: 100000000,
        responseType: 'stream',
        onDownloadProgress: function (progressEvent) {
            console.log("progressEvent->", progressEvent.event.currentTarget.responseText)
            document.getElementById("app").innerHTML =
                progressEvent.event.currentTarget.responseText;

        },
    });

    http.get('/sseAll')
        .then(function (response) {
            // 处理成功情况
            console.log(response);
        })
        .catch(function (error) {
            // 处理错误情况
            console.log(error);
        })
        .finally(function () {
            // 总是会执行
        });

</script>
</body>
</html>